﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" x:Class="Nok_Air.AppBarMenuUserControl"
    mc:Ignorable="d"
    d:DesignHeight="100  " d:DesignWidth="480" FontFamily="/Nok Air;component/Fonts/Fonts.zip#PSL Display">
    <UserControl.Resources>

        <Style x:Key="AppBarButtonStyle" TargetType="Button">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
            <Setter Property="FontFamily" Value="/Nok Air;component/Fonts/Fonts.zip#PSL Display"/>
            <Setter Property="FontSize" Value="32"/>
            <Setter Property="Padding" Value="0,0,0,0"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="Transparent" Margin="0,0,0,0">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ColorAnimation Duration="0" To="#E6FFFFFF" Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Color)" Storyboard.TargetName="ContentContainer" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Margin="5">
                                <ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Background="Black">
                                    <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                </ContentControl>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
	<UserControl.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</UserControl.Foreground>
	<UserControl.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</UserControl.FontSize>
    <Grid x:Name="LayoutRoot">
    	<Grid.Background>
            	            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    			<GradientStop Color="#FF464848" Offset="0"/>
                    			<GradientStop Color="Black" Offset="0.5"/>
                    			<GradientStop Color="#FF101010" Offset="0.48"/>
                    			<GradientStop Color="#FF101010" Offset="1"/>
                    		</LinearGradientBrush>
    	</Grid.Background>
            <Grid Margin="10,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
            <Button Grid.Column="0" Padding="10,0" x:Name="nokAppButton" Foreground="White" Style="{StaticResource AppBarButtonStyle}" HorizontalAlignment="Center">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ic:NavigateToPageAction TargetPage="/MainPage.xaml"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
                <StackPanel VerticalAlignment="Top">
                    <Image Source="/Images/AppBar/iconbar_nok.png" Width="47" Height="47" Margin="0"/>
                    <TextBlock Text="{Binding NokAir}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="29.333" Margin="0,-5,0,0" />
					</StackPanel>            
				</Button>
                <Button Grid.Column="1"  x:Name="AboutNokAppButton" Style="{StaticResource AppBarButtonStyle}" Foreground="White" HorizontalAlignment="Center" Padding="10,0">
                	<i:Interaction.Triggers>
                		<i:EventTrigger EventName="Click">
                			<ic:NavigateToPageAction TargetPage="/AboutPage.xaml"/>
                		</i:EventTrigger>
                	</i:Interaction.Triggers>
                	<StackPanel VerticalAlignment="Top">
					<Image Source="/Images/AppBar/iconbar_about.png" Width="47" Height="47" Margin="0"/>
                    <TextBlock Text="{Binding About}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="29.333" Margin="0,-5,0,0"/>
					</StackPanel>            
				</Button>
                <Button Grid.Column="2"  x:Name="languageButton" Style="{StaticResource AppBarButtonStyle}" Foreground="White" Click="languageButton_Click">
                	<StackPanel VerticalAlignment="Top">
					<Image Source="/Images/AppBar/iconbar_then.png" Width="47" Height="47" Margin="0"/>
                    <TextBlock Text="{Binding Language}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="29.333" Margin="0,-5,0,0"/>
					</StackPanel>                
				</Button>
            </Grid>
        </Grid>
</UserControl>
